package com.fhz.high5kotlin.life

import android.app.Dialog
import android.util.Log
import androidx.lifecycle.*
import com.fhz.high5kotlin.widget.MyDialog
import kotlin.math.E

/**
 * 时间:2023/3/23
 * @author Mr.Feng
 * 简述: TODO
 */
class MyLife(var myDialog: MyDialog) : DefaultLifecycleObserver {

    private  val TAG = "MyLife"
    @OnLifecycleEvent(Lifecycle.Event.ON_START)
    fun start(){
        myDialog.show()
        Log.i(TAG, "start: ")
    }


    @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
    fun stop(){
        Log.i(TAG, "stop: ")
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    fun destroy(){
        myDialog.dismiss()
        Log.i(TAG, "destroy: ")
    }
}